<?php 
  $pageDebut = $this->numpage-1;
  $pageFin = $this->numpage+1;
  $nbPageMax = 10;
  $nombreElement = $this->nb;
  $elementParPage = $this->tailleliste;
  $nombrePage = $this->nb % $this->tailleliste ;
  $nombrePage = ( $nombrePage == 0 ? $this->nb / $this->tailleliste : intval($this->nb / $this->tailleliste)+1);
  $urlSuiv = $this->smartUrl($this->paginatorAction, $this->paginatorController, $this->paginatorModule, array('page' => ($pageFin > $nombrePage ? $nombrePage : $pageFin)));
  $urlPrec = $this->smartUrl($this->paginatorAction, $this->paginatorController, $this->paginatorModule, array('page' => ($pageDebut == 0 ? 1 : $pageDebut)));
  
//   $this->jQuery()->addOnLoad("
//     $('.uiblock').click(function(){
//       $.blockUI({
//         theme: true,
//         title: '" . __("Changement de page en cours") . "',
//         message: '<p>" . __("Merci de patienter, nous chargeons vos données.")  . "</p>'
//       });
//     });
//   ");
?>

<div id="tnt_pagination">
<?php if ( $nombrePage > $nbPageMax ) : ?>
  <?php if ( $pageDebut != 0 ) : ?>
  <a href="<?php echo $urlPrec?>"><?php echo __("Suiv")?></a>
  <?php else : ?>
  <span class="disabled_tnt_pagination"><?php echo __("Prec")?></span>
  <?php endif; ?>
<?php endif; ?>
<!-- Numbered page links -->
<?php for ( $i = 1; $i <= $nombrePage; $i++): ?> 
	<?php if ($i != $this->numpage): ?>		 
		<a href="<?php echo $this->url(array('page' => $i)); ?>" class="uiblock"><?php echo $i; ?></a>
	<?php else: ?> 
		<span class="active_tnt_link"><?php echo $i?></span> 
	<?php endif; ?>
<?php endfor; ?>
<?php if ( $nombrePage > $nbPageMax ) : ?>
  <?php if ( $pageFin <= $nombrePage ) : ?>
  <a href="<?php echo $urlSuiv?>"><?php echo __("Suiv")?></a>
  <?php endif;?>
<?php endif;?>
</div>